#pragma once
#include <ois/OIS.h>
#include <OgreFrameListener.h>
#include "UIBase.h"
#include "CameraManager.h"
class GameFrameListener : public Ogre::FrameListener, public OIS::MouseListener, public OIS::KeyListener
{
public:
	GameFrameListener(Ogre::RenderWindow* pOgreWin);
	~GameFrameListener(void);
	virtual bool frameStarted(const Ogre::FrameEvent& evt);
	// Input System
	virtual bool mouseMoved(const OIS::MouseEvent &arg);
	virtual bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	virtual bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	virtual bool keyPressed(const OIS::KeyEvent& e);
	virtual bool keyReleased(const OIS::KeyEvent& e);
	CEGUI::MouseButton convertOISButtonToCEGUI(int buttonID);
	void setUIBase(UIBase* pUI);
	void setCameraManager(CameraManager* pCamMgr);
protected:
	// Input System
	OIS::InputManager* m_pOISMgr;
	OIS::Mouse* m_pOISMouse;
	OIS::Keyboard* m_pOISKeyboard;
	bool m_bQuit;

	CEGUI::System* m_pUISystem;
	Ogre::RenderWindow* m_pOgreWin;

	UIBase* m_pUI;
	CameraManager* m_pCameraMgr;
};
